/**
 * @Author: aesoper
 * @Description:
 * @File:  consts
 * @Version: 1.0.0
 * @Date: 2020/7/22 14:14
 */

package errors

import "net/http"

var (
	OK                             = NewAPIError(0, "成功返回数据")
	ErrUnknown                     = NewAPIError(-1, "未知错误")
	ErrParameter                   = NewAPIError(http.StatusBadRequest, "参数错误", http.StatusBadRequest)
	ErrForbidden                   = NewAPIError(http.StatusForbidden, "禁止访问", http.StatusForbidden)
	ErrNotFound                    = NewAPIError(http.StatusNotFound, "资源不存在", http.StatusNotFound)
	ErrUnauthorized                = NewAPIError(http.StatusUnauthorized, "未获得授权", http.StatusUnauthorized)
	ErrTooManyRequests             = NewAPIError(http.StatusTooManyRequests, "请求已达到上限", http.StatusTooManyRequests)
	ErrRequestMethodNotAllowed     = NewAPIError(http.StatusMethodNotAllowed, "请求方法错误", http.StatusMethodNotAllowed)
	ErrInternalServer              = NewAPIError(http.StatusInternalServerError, "服务器内部错误", http.StatusInternalServerError)
	ErrBadGateway                  = NewAPIError(http.StatusBadGateway, "错误网关", http.StatusBadGateway)
	ErrGatewayTimeout              = NewAPIError(http.StatusGatewayTimeout, "网关超时", http.StatusGatewayTimeout)
	ErrStatusRequestEntityTooLarge = NewAPIError(http.StatusRequestEntityTooLarge, "请求body大小超过限制", http.StatusRequestEntityTooLarge)

	DBError = NewAPIError(9999, "数据库访问错误", http.StatusInternalServerError)
)
